package com.example.peibei.service.presenter;

import com.dingtao.common.core.DataCall;
import com.dingtao.common.core.WDPresenter;
import com.dingtao.common.core.http.IAppRequest;

import io.reactivex.Observable;

public class ServiceOrderListPresenter extends WDPresenter<IAppRequest> {

    private int page = 1;

    public ServiceOrderListPresenter(DataCall dataCall) {
        super(dataCall);
    }
    public int getPage() {
        return page;
    }

    @Override
    protected Observable getModel(Object... args) {
        boolean refresh = (boolean)args[2];
        if (refresh){
            page = 1;
        }else{
            page++;
        }
        return iRequest.serviceOrderList((String)args[0], (String) args[1],page,20);

    }

    public boolean isRefresh(){
        return page == 1;
    }
}
